<%@ page contentType="application/json;charset=UTF-8" language="java" %><%--
--%><%@ page import="java.util.Collection" %><%--
--%><%@ page import="com.google.appengine.api.users.User" %><%--
--%><%@ page import="com.google.appengine.api.users.UserService" %><%--
--%><%@ page import="com.google.appengine.api.users.UserServiceFactory" %><%--
--%><%!

public String ifNull(String value, String def) {
	if (value == null) {
		return def;
	}

	return value;
}

%><%

	final UserService us = UserServiceFactory.getUserService();
	if (!us.isUserLoggedIn()) {
//		final String thisURL = request.getRequestURI();
//		response.sendRedirect(us.createLoginURL(thisURL));
		final String newURL = ifNull(request.getParameter("url"), "");
		response.sendRedirect(us.createLoginURL(newURL));
		return;
	}

%>
